package com.cyj.springbootservice.api.entity.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @description:
 * @Author C_Y_J
 * @create 2021/10/7 11:50
 **/
@Getter
public enum AerialMode {
    //航拍类型  	1:倾斜摄影,	2:建图航拍  3:快易拼
    SLANT(1, "倾斜摄影"),
    DRAWING(2, "建图航拍"),
    QUICK_EASY_TO_SPELL(3, "快易拼");

    @JsonValue
    @EnumValue
    private final int code;
    private final String name;

    AerialMode(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static AerialMode valueOf(int code) {
        for (AerialMode item : values()) {
            if (item.getCode() == code) {
                return item;
            }
        }
        return null;
    }
}
